package com.wtu.alicloud.client.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chenmx on 2019-05-21.
 */
@RestController
@RequestMapping(value = "/config")
@RefreshScope
public class ConfigController {

    @Value("${client.key:false}")
    //必须要加上:，不然解析失败
    private String key;


    @GetMapping(value = "/key")
    public String getConfigKey(){

        String result = key;
        return key;
    }
}
